using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using RideMe.AddIns.Interfaces;
using RideMe.Core;

namespace RideMe.Presentation
{
    /// <summary>
    /// This provides an easy way to present add-in options to the user
    /// </summary>
    public partial class AddInOptionsPanel : UserControl
    {
        #region Constructor

        /// <summary>
        /// Constructor to create an add-in options panel, initializing it
        /// </summary>
        public AddInOptionsPanel()
        {
            InitializeComponent();
        }

        #endregion

        #region Properties

        /// <summary>
        /// This gets/sets the name of the add-in this info panel represents
        /// </summary>
        public string AddInName
        {
            get { return addInNameValueLabel.Text; }
            set { addInNameValueLabel.Text = value; }
        }

        /// <summary>
        /// This gets/sets the author of the add-in this info panel represents
        /// </summary>
        public string AddInAuthor
        {
            get { return addInAuthorValueLabel.Text; }
            set { addInAuthorValueLabel.Text = value; }
        }

        /// <summary>
        /// This gets/sets the description of the add-in this info panel represents
        /// </summary>
        public string AddInDescription
        {
            get { return addInDescriptionValueLabel.Text; }
            set { addInDescriptionValueLabel.Text = value; }
        }

        /// <summary>
        /// This returns the group box for the add-ins options
        /// </summary>
        public GroupBox OptionsGroupBox
        {
            get { return optionsGroup; }
        }

        #endregion

        #region Methods

        /// <summary>
        /// This updates the active add-in for the options panel
        /// </summary>
        /// <param name="addin"></param>
        public void SetActiveAddIn(IAddIn addin)
        {            
            this.AddInName = addin.Name;
            this.AddInAuthor = addin.Author;
            this.AddInDescription = addin.Description;
        }

        #endregion
    }
}
